<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>Universities</title>
    <script type="text/javascript" src="/voteup/resources/js/jquery-1.6.1.js"></script>
    <script type="text/javascript" src="/voteup/resources/js/stylescript.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $(".univerli").click(function() {
                univerid = $(this).find("a").attr("href");
                $("#u" + univerid).slideToggle("slow");
                $(this).toggleClass("univerliactive");
                return false;
            });
            $(".facultyli").click(function() {
                facultyid = $(this).find("a").attr("href");
                $("#f" + facultyid).slideToggle("slow");
                $(this).toggleClass("facultyactive");
                return false;
            });
            $("#groupul li").click(function() {
                window.location = $(this).find("a").attr("href");
                return false;
            });
        });
    </script>
</head>
<body>
<c:import url="/WEB-INF/jsp/header.jsp"/>
<c:import url="/WEB-INF/jsp/menu.jsp"/>
<!--<center>-->
<h3>Universities</h3>
<ul class="pane-list" id="univerul">
    <c:forEach items="${universities}" var="university">
        <li class="univerli">
            <a href="${university.universityId}"></a>${university.universityName}
        </li>
        <div class="universlidepanel" id="u${university.universityId}">
            <ul class="pane-list" id="facultyul">
                <h4>Faculties of <a
                        href="/voteup/universities/${university.universityId}">${university.universityName}</a>:
                </h4>
                <c:forEach items="${university.faculties}" var="faculty">
                    <li class="facultyli"><a href="${faculty.facultyId}"></a>${faculty.facultyName}</li>
                    <div class="facultyslidepanel" id="f${faculty.facultyId}">
                        <ul class="pane-list" id="groupul">
                            <c:if test="${not empty faculty.groups}"><h4>Groups of <a
                                    href="/voteup/faculties/${faculty.facultyId}">${faculty.facultyName}</a>
                                faculty:</h4></c:if>
                            <c:if test="${empty faculty.groups}"><h4>There are no registered groups on <a
                                    href="/voteup/faculties/${faculty.facultyId}">${faculty.facultyName}</a>
                                faculty</h4></c:if>
                            <c:forEach items="${faculty.groups}" var="group">
                                <li class="groupli">
                                    <a href="/voteup/groups/${group.groupId}">${group.groupName}</a>
                                </li>
                            </c:forEach>
                        </ul>
                    </div>
                </c:forEach>
            </ul>
        </div>

    </c:forEach>
</ul>
</body>
</html>